<template>
  <view class="content">
    <view class="title">
      <text>子组件A</text>
    </view>
    <view class="coma_box">
      <text class="label">父组件传进来的值：</text>
      <text class="value">{{intent}}</text>
    </view>
    <button type="primary" @click="sendData()">传值给CompB组件</button>
  </view>
</template>

<script>
export default {
  props: ['intent'],
  data() {
    return {};
  },
  methods: {
    sendData() {
      console.warn('---CompA---sendData----->' + this.intent);
      uni.$emit('getIntent', this.intent);
    }
  }
};
</script>

<style>
.content {
  padding: 20rpx;
  background-color: #f8f8f8; /* 子组件A的背景色 */
}

.title {
  text-align: center;
  margin-bottom: 20rpx;
  font-size: 40rpx;
  font-weight: bold;
}

.coma_box {
  margin-bottom: 20rpx;
  text-align: center;
  font-size: 30rpx;
}

.coma_box .label {
  font-weight: bold;
  color: #666;
}

.coma_box .value {
  font-weight: bold;
  color: red;
}
</style>